package com.brush.app.domain.req.Ad.query;

import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.brush.common.core.domain.page.PageAbstructReq;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.annotations.ApiOperation;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

import java.util.Date;

@Getter
@Setter
@ApiModel(value = "AppAdQueryReq",description = "广告查询参数")
@ToString(callSuper = true)
public class AppAdQueryReq extends PageAbstructReq {
    /**
     * 主键id
     */
    @ApiModelProperty(value = "主键id")
    private Integer id;

    /**
     * 广告名name
     */
    @ApiModelProperty(value = "广告名name")
    private String name;


    /**
     * 该条广告结束时间endTime
     */
    @ApiModelProperty(value = "该条广告结束时间endTime")
    private Date endTime;

    /**
     * 状态（0正常 1停用）
     */
    @ApiModelProperty(value = "状态（0正常 1停用）")
    private String status;

    @Override
    public String getOrderBy() {
        if (StrUtil.isNotBlank(super.getOrderByColumn())){
            return super.getOrderByColumn() + " " + super.getIsAsc();
        }
        return null;
    }
}
